$(document).ready(function(){
    $(".nav-1").mouseover(function(){
        $(".nav-1").css({"background-color":"#1e90ff","color":"#fff"});
    });
    $(".nav-1").mouseout(function(){
        if($(".nav-1").attr("class") == "nav-1 dianji") {
            return;
        }
        else {
            $(".nav-1").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-1").css("background-color", "#708090");
        }
    });
    $(".nav-2").mouseover(function(){
        if(".")
        $(".nav-2").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-2").css("background-color", "#1e90ff");
    });
    $(".nav-2").mouseout(function(){
        if($(".nav-2").attr("class") == "nav-2 dianji") {
            return;
        }
        else {
            $(".nav-2").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-2").css("background-color", "#708090");
        }
    });
    $(".nav-3").mouseover(function(){
        $(".nav-3").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-3").css("background-color", "#1e90ff");
    });
    $(".nav-3").mouseout(function(){
        if($(".nav-3").attr("class") == "nav-3 dianji") {
            return;
        }
        else {
            $(".nav-3").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-3").css("background-color", "#708090");
        } 
    });
    $(".nav-4").mouseover(function(){
        $(".nav-4").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-4").css("background-color", "#1e90ff");
    });
    $(".nav-4").mouseout(function(){
        if($(".nav-4").attr("class") == "nav-4 dianji") {
            return;
        }
        else {
            $(".nav-4").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-4").css("background-color", "#708090");
        } 
    });
    $(".nav-5").mouseover(function(){
        $(".nav-5").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-5").css("background-color", "#1e90ff");
    });
    $(".nav-5").mouseout(function(){
        if($(".nav-5").attr("class") == "nav-5 dianji") {
            return;
        }
        else {
            $(".nav-5").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-5").css("background-color", "#708090");
        } 
    });
    $(".nav-6").mouseover(function(){
        $(".nav-6").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-6").css("background-color", "#1e90ff");
    });
    $(".nav-6").mouseout(function(){
        if($(".nav-6").attr("class") == "nav-6 dianji") {
            return;
        }
        else {
            $(".nav-6").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-6").css("background-color", "#708090");
        } 
    });
    $(".nav-7").mouseover(function(){
        $(".nav-7").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-7").css("background-color", "#1e90ff");
    });
    $(".nav-7").mouseout(function(){
        if($(".nav-7").attr("class") == "nav-7 dianji") {
            return;
        }
        else {
            $(".nav-7").css({"background-color":"#fff","color":"#05173b"});
            $(".dot-7").css("background-color", "#708090");
        } 
    });
});
$(document).ready(function(){
    $(".nav-1").click(function(){
        $(".details").show();
    });
});
$(document).ready(function(){
    var options = {
          useEasing : true, 
          useGrouping : true, 
          separator : '', 
          decimal : '.', 
          prefix : '', 
          suffix : '' 
        };
    var readTime = new CountUp("read", 0, 512, 0, 2, options);
    var forwardingTime = new CountUp("forwarding", 0, 1215, 0, 3, options);
    var commentTime = new CountUp("comment", 0, 1169, 0, 2, options);
    var newsTime = new CountUp("news", 0, 503, 0, 3, options);
    var baidu_entry_time = new CountUp("baidu-entry", 0, 15, 0, 3, options);
    $(window).scroll(function(){
        if($(window).scrollTop() >= 1100) {
            readTime.start();
        }
        if($(window).scrollTop() >= 1200) {
            forwardingTime.start();
            commentTime.start();
            newsTime.start();
            baidu_entry_time.start();
        }
        if($(window).scrollTop() >= 1019) {
            if($(".details-1").css("display") == "none") {
            }
            else {
                $(".effect-item,.effect-item-1,.effect-item-2").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 400) {
            if($(".details-3").css("display") == "none") {

            }
            else {
                $(".application-item").css("animation-play-state", "running");
            }
            if($(".details").css("display") == "none") {

            }
            else {
                $(".details .content .brands .introduce").css("animation-play-state", "running");
            }
            if($(".details-4").css("display") =="none") {

            }
            else {
                $(".key-words").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 480) {
            if($(".details").css("display") == "none") {

            }
            else {
                $(".details .content .brands .introduce").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 600) {
            if($(".details-4").css("display") == "none") {

            }
            else {
                $(".time,.details-4 .content .optimization .background-image").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 700) {
            if($(".details-4").css("display") == "none") {

            }
            else {
                $(".strategy").css("animation-play-state", "running");
            }
            if($(".details").css("display") == "none") {

            }
            else {
                $(".details .content .brands .program,.details .content .brands .background-image").css("animation-play-state", "running");
            }
            if($(".details-1").css("display") == "none") {

            }
            else {
                $(".details-1 .content .anime .effect").css("animation-play-state", "running");
            } 
        }
        if($(window).scrollTop() >= 577) {
            if($(".details-3").css("display") == "none") {

            }
            else {
                $(".details-3 .content .background-image").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 877) {
            if($(".details-3").css("display") == "none") {

            }
            else {
                $(".application-item-1").css("animation-play-state", "running");
            }
            if($(".details-4").css("display") == "none") {

            }
            else {
                $(".details-4 .content .optimization .effect").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 300) {

            $(".details .head,.details-1 .head-1,.details-2 .head-2,.details-3 .head-3,.details-4 .head-4,.details-5 .head-5,.details-6 .head-6").css("animation-play-state", "running");
        }
        if($(window).scrollTop() >= 430) {
            if($(".details-6").css("display") == "none") {

            }
            else {
                $(".details-6 .content .marketing .advertisers").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 460) {
            if($(".details-1").css("display") == "none") {

            }
            else {
                $(".details-1 .content .anime .introduce").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 530) {
            if($(".details-6").css("display") == "none") {

            }
            else {
                $(".details-6 .content .marketing .time").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 630) {
            if($(".details-6").css("display") == "none") {

            }
            else {
                $(".details-6 .content .marketing .background-image").css("animation-play-state", "running");
            }
            if($(".details-1").css("display") == "none") {

            }
            else {
                $(".details-1 .content .anime .background-image,.details-1 .content .anime .program").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 730) {
            if($(".details-6").css("display") == "none") {

            }
            else {
                $(".details-6 .content .marketing .range").css("animation-play-state", "running");
            } 
        }
        if($(window).scrollTop() >= 436) {
            if($(".details-2").css("display") == "none") {

            }
            else {
               $(".details-2 .content .loan .introduce").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 656) {
            if($(".details-2").css("display") == "none") {

            }
            else {
               $(".details-2 .content .loan .program").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 836) {
            if($(".details-2").css("display") == "none") {

            }
            else {
                $(".details-2 .content .loan .background-image,.details-2 .content .loan .effect .title").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 996) {
            if($(".details-2").css("display") == "none") {

            }
            else {
                $(".details-2 .content .loan .effect .loan-item,.details-2 .content .loan .effect .loan-item-1").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 500) {
            if($(".details-5").css("display") == "none") {

            }
            else {
                $(".details-5 .content .media .advertisers").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 600) {
            if($(".details-5").css("display") == "none") {

            }
            else {
                $(".details-5 .content .media .serve").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 700) {
            if($(".details-5").css("display") == "none") {
                
            }
            else {
                $(".details-5 .content .media .highlight,.details-5 .content .media .background-image").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 900) {
            if($(".details-5").css("display") == "none") {

            }
            else {
                $(".details-5 .content .media .effect").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 830) {
            if($(".details-6").css("display") == "none") {

            }
            else {
                $(".details-6 .content .marketing .service").css("animation-play-state", "running");
            }
        }
        if($(window).scrollTop() >= 930) {
            if($(".details-6").css("display") == "none") {

            }
            else {
                $(".details-6 .content .marketing .effect").css("animation-play-state", "running");
            }
        }
    });
});
$(document).ready(function(){
    $(".nav-1").click(function(){
        $(".details").show(500);
        $(".details").siblings().hide();
        $(".nav-1").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-1").siblings().removeClass("dianji");
        $(".nav-5,.nav-6,.nav-7").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-1").css({"background-color":"#1e90ff","color":"#fff"});
        $(".nav-1").addClass("dianji");
        $(".dot-1").siblings().css("background", "#708090");
        $(".dot-1").css("background-color", "#1e90ff");
    });
    $(".nav-2").click(function(){
        $(".details-1").show();
        $(".details-1").siblings().hide();
        $(".nav-2").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-2").siblings().removeClass("dianji");
        $(".nav-5,.nav-6,.nav-7").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-2").addClass("dianji");
        $(".nav-2").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-2").siblings().css("background", "#708090");
        $(".dot-2").css("background-color", "#1e90ff");
    });
    $(".nav-3").click(function(){
        $(".details-2").show();
        $(".details-2").siblings().hide();
        $(".nav-3").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-3").siblings().removeClass("dianji");
        $(".nav-5,.nav-6,.nav-7").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-3").addClass("dianji");
        $(".nav-3").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-3").siblings().css("background", "#708090");
        $(".dot-3").css("background-color", "#1e90ff");
    });
    $(".nav-4").click(function(){
        $(".details-3").show();
        $(".details-3").siblings().hide();
        $(".nav-4").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-4").siblings().removeClass("dianji");
        $(".nav-5,.nav-6,.nav-7").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-4").addClass("dianji");
        $(".nav-4").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-4").siblings().css("background", "#708090");
        $(".dot-4").css("background-color", "#1e90ff");
    });
    $(".nav-5").click(function(){
        $(".details-4").show();
        $(".details-4").siblings().hide();
        $(".nav-5").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-5").siblings().removeClass("dianji");
        $(".nav-1,.nav-2,.nav-3,.nav-4").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-5").addClass("dianji");
        $(".nav-5").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-5").siblings().css("background", "#708090");
        $(".dot-5").css("background-color", "#1e90ff");
    });
    $(".nav-6").click(function(){
        $(".details-5").show();
        $(".details-5").siblings().hide();
        $(".nav-6").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-6").siblings().removeClass("dianji");
        $(".nav-1,.nav-2,.nav-3,.nav-4").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-6").addClass("dianji");
        $(".nav-6").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-6").siblings().css("background", "#708090");
        $(".dot-6").css("background-color", "#1e90ff");
    });
    $(".nav-7").click(function(){
        $(".details-6").show();
        $(".details-6").siblings().hide();
        $(".nav-7").siblings().css({"background-color":"#fff","color":"#05173b"});
        $(".nav-7").siblings().removeClass("dianji");
        $(".nav-1,.nav-2,.nav-3,.nav-4").css({"background-color":"#fff","color":"#05173b"});
        $(".nav-7").addClass("dianji");
        $(".nav-7").css({"background-color":"#1e90ff","color":"#fff"});
        $(".dot-7").siblings().css("background", "#708090");
        $(".dot-7").css("background-color", "#1e90ff");
    });
})